<template>
	<view class="userInfo-layout pageBg">
		<view class="userInfo flex-center">
			<image src="/static/logo.png" class="avatar" mode="aspectFill"></image>
			<view class="ip">
				100.100.100.10
			</view>
			<view class="address">
				来自于山东
			</view>
		</view>
		
		<view class="section">
			<user-item leftIcon="download-filled" leftName="我的下载" rightNum="20"></user-item>
			<user-item leftIcon="star-filled" leftName="我的评分" rightNum="20"></user-item>
			<user-item leftIcon="chatboxes-filled" leftName="联系客服">
				<!-- #ifdef MP -->
					<button class="contact-btn" open-type="contact">联系客服</button>
				<!-- #endif -->
				<!-- #ifndef MP -->
					<button class="contact-btn" @click="handleContact">拨打电话</button>
				<!-- #endif -->
				
			</user-item>
		</view>
		<view class="section">
			<user-item leftIcon="notification-filled" leftName="订阅更新"></user-item>
			<user-item leftIcon="flag-filled" leftName="常见问题"></user-item>
		</view>
	</view>
</template>

<script setup>
	const handleContact = function() {
		uni.makePhoneCall({
			phoneNumber: '114'
		})
	}
</script>

<style lang="scss" scoped>
.userInfo-layout {
	.userInfo {
		flex-direction: column;
		padding: 50rpx 0;
		.avatar {
			width: 160rpx;
			height: 160rpx;
			border-radius: 50%;
		}
		.ip {
			font-size: 44rpx;
			color: #333;
			margin: 20rpx 0 5rpx;
		}
		.address {
			font-size: 28rpx;
			color: #aaa;
			
		}
	}
	.section {
		margin: 50rpx 30rpx;
		border: 1px solid #eee;
		box-shadow: 0 0 30rpx 10rpx rgba(0, 0, 0, 0.05);
		border-radius: 10rpx;
		:deep(.row:last-child) {
			border-bottom: 0;
		}
		:deep(.row) {
			position: relative;
		}
		.contact-btn {
			position: absolute;
			top: 0;
			left: 0;
			right: 0;
			bottom: 0;
			opacity: 0;
		}
	}
}       
</style>
